package com.mor.shiro.test.sort;

/**
 * @author zht
 * @version 1.0
 * @createDate 2020/07/14 22:14
 */

public class BubbleSort {

    private static  void sort(int [] array){
        for(int i=0;i<array.length;i++){
            int flag= 0;
            for (int j = 0; j <array.length-i-1 ; j++) {
                if(array[j]>array[j+1]){
                    int temp=array[j+1];
                    array[j+1]=array[j];
                    array[j]=temp;
                    flag=1;
                }
            }
           if (flag==1){
               return;
           }
        }

    }
    static final int hash(Object key) {
        int h;
        return (key == null) ? 0 : (h = key.hashCode()) ^ (h >>> 16);
    }

    public static void main(String[] args) {
        String test="testtesttestsetsetset";
        System.out.println(Integer.toBinaryString(test.hashCode()));
        System.out.println("0000000000000000"+Integer.toBinaryString(test.hashCode()>>> 16));
        System.out.println(Integer.toBinaryString(test.hashCode()>>> 16^test.hashCode()));
    }
}
